﻿using System;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Text;

namespace SdmxMl.Helper
{
    public class GridHelper
    {
        public static void highlightRange(DataGridView dR, System.Drawing.Point p1, System.Drawing.Point p2, System.Drawing.Color colr)
        {
            //reset to white
            foreach (DataGridViewRow drw in dR.Rows)
            {
                foreach (DataGridViewCell drc in drw.Cells)
                {
                    drc.Style.BackColor = System.Drawing.Color.White;
                }
            }
            //highlight desired range
            for (int i = p1.Y; i <= p2.Y; i++)
            {
                for (int n = p1.X; n <= p2.X; n++)
                {
                    dR.Rows[i].Cells[n].Style.BackColor = colr;
                }
            }
        }

    }
}
